home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / Components.a < prev    next >
Encoding:
Text File  |  1998-02-12  |  26.1 KB  |  897 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Components.a
  3. ;
  4. ;    Contains:    Component Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.1
  8. ;
  9. ;    Copyright:    © 1991-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__COMPONENTS__') = 'UNDEFINED' THEN
  19. __COMPONENTS__ SET 1
  20.  
  21.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  22.     include 'Errors.a'
  23.     ENDIF
  24.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  25.     include 'MacTypes.a'
  26.     ENDIF
  27.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  28.     include 'MixedMode.a'
  29.     ENDIF
  30.  
  31.  
  32. kAppleManufacturer                EQU        'appl'                ; Apple supplied components 
  33. kComponentResourceType            EQU        'thng'                ; a components resource type 
  34. kComponentAliasResourceType        EQU        'thga'                ; component alias resource type 
  35.  
  36. kAnyComponentType                EQU        0
  37. kAnyComponentSubType            EQU        0
  38. kAnyComponentManufacturer        EQU        0
  39. kAnyComponentFlagsMask            EQU        0
  40.  
  41. cmpWantsRegisterMessage            EQU        $80000000
  42. cmpIsComponentAlias                EQU        $10000000
  43.  
  44. kComponentOpenSelect            EQU        -1                    ; ComponentInstance for this open 
  45. kComponentCloseSelect            EQU        -2                    ; ComponentInstance for this close 
  46. kComponentCanDoSelect            EQU        -3                    ; selector # being queried 
  47. kComponentVersionSelect            EQU        -4                    ; no params 
  48. kComponentRegisterSelect        EQU        -5                    ; no params 
  49. kComponentTargetSelect            EQU        -6                    ; ComponentInstance for top of call chain 
  50. kComponentUnregisterSelect        EQU        -7                    ; no params 
  51. kComponentGetMPWorkFunctionSelect EQU    -8                    ; some params 
  52. ;  Component Resource Extension flags 
  53.  
  54. componentDoAutoVersion            EQU        $01
  55. componentWantsUnregister        EQU        $02
  56. componentAutoVersionIncludeFlags EQU    $04
  57. componentHasMultiplePlatforms    EQU        $08
  58. componentLoadResident            EQU        $10
  59.  
  60.  
  61. ;  Set Default Component flags 
  62.  
  63. defaultComponentIdentical        EQU        0
  64. defaultComponentAnyFlags        EQU        1
  65. defaultComponentAnyManufacturer    EQU        2
  66. defaultComponentAnySubType        EQU        4
  67. defaultComponentAnyFlagsAnyManufacturer EQU 3
  68. defaultComponentAnyFlagsAnyManufacturerAnySubType EQU 7
  69. ;  RegisterComponentResource flags 
  70.  
  71. registerComponentGlobal            EQU        1
  72. registerComponentNoDuplicates    EQU        2
  73. registerComponentAfterExisting    EQU        4
  74. registerComponentAliasesOnly    EQU        8
  75.  
  76. ComponentDescription    RECORD 0
  77. componentType             ds.l    1                ; offset: $0 (0)        ;  A unique 4-byte code indentifying the command set 
  78. componentSubType         ds.l    1                ; offset: $4 (4)        ;  Particular flavor of this instance 
  79. componentManufacturer     ds.l    1                ; offset: $8 (8)        ;  Vendor indentification 
  80. componentFlags             ds.l    1                ; offset: $C (12)        ;  8 each for Component,Type,SubType,Manuf/revision 
  81. componentFlagsMask         ds.l    1                ; offset: $10 (16)        ;  Mask for specifying which flags to consider in search, zero during registration 
  82. sizeof                     EQU *                    ; size:   $14 (20)
  83.                         ENDR
  84.  
  85. ResourceSpec            RECORD 0
  86. resType                     ds.l    1                ; offset: $0 (0)        ;  4-byte code  
  87. resID                     ds.w    1                ; offset: $4 (4)        ;               
  88. sizeof                     EQU *                    ; size:   $6 (6)
  89.                         ENDR
  90. ComponentResource        RECORD 0
  91. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  Registration parameters 
  92. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  93. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  94. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  95. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  96. sizeof                     EQU *                    ; size:   $2C (44)
  97.                         ENDR
  98. ; typedef struct ComponentResource *    ComponentResourcePtr
  99.  
  100. ; typedef ComponentResourcePtr *        ComponentResourceHandle
  101.  
  102. ComponentPlatformInfo    RECORD 0
  103. componentFlags             ds.l    1                ; offset: $0 (0)        ;  flags of Component 
  104. component                 ds        ResourceSpec    ; offset: $4 (4)        ;  resource where Component code is found 
  105. platformType             ds.w    1                ; offset: $A (10)        ;  gestaltSysArchitecture result 
  106. sizeof                     EQU *                    ; size:   $C (12)
  107.                         ENDR
  108. ComponentResourceExtension RECORD 0
  109. componentVersion         ds.l    1                ; offset: $0 (0)        ;  version of Component 
  110. componentRegisterFlags     ds.l    1                ; offset: $4 (4)        ;  flags for registration 
  111. componentIconFamily         ds.w    1                ; offset: $8 (8)        ;  resource id of Icon Family 
  112. sizeof                     EQU *                    ; size:   $A (10)
  113.                         ENDR
  114. ComponentPlatformInfoArray RECORD 0
  115. count                     ds.l    1                ; offset: $0 (0)
  116. platformArray             ds        ComponentPlatformInfo ; offset: $4 (4) <-- really an array of length one
  117. sizeof                     EQU *                    ; size:   $10 (16)
  118.                         ENDR
  119. ExtComponentResource    RECORD 0
  120. cd                         ds        ComponentDescription ; offset: $0 (0)    ;  registration parameters 
  121. component                 ds        ResourceSpec    ; offset: $14 (20)        ;  resource where Component code is found 
  122. componentName             ds        ResourceSpec    ; offset: $1A (26)        ;  name string resource 
  123. componentInfo             ds        ResourceSpec    ; offset: $20 (32)        ;  info string resource 
  124. componentIcon             ds        ResourceSpec    ; offset: $26 (38)        ;  icon resource 
  125. componentVersion         ds.l    1                ; offset: $2C (44)        ;  version of Component 
  126. componentRegisterFlags     ds.l    1                ; offset: $30 (48)        ;  flags for registration 
  127. componentIconFamily         ds.w    1                ; offset: $34 (52)        ;  resource id of Icon Family 
  128. count                     ds.l    1                ; offset: $36 (54)        ;  elements in platformArray 
  129. platformArray             ds        ComponentPlatformInfo ; offset: $3A (58) <-- really an array of length one
  130. sizeof                     EQU *                    ; size:   $46 (70)
  131.                         ENDR
  132. ComponentAliasResource    RECORD 0
  133. cr                         ds        ComponentResource ; offset: $0 (0)        ;  Registration parameters 
  134. aliasCD                     ds        ComponentDescription ; offset: $2C (44) ;  component alias description 
  135. sizeof                     EQU *                    ; size:   $40 (64)
  136.                         ENDR
  137. ;   Structure received by Component:        
  138. ComponentParameters        RECORD 0
  139. flags                     ds.b    1                ; offset: $0 (0)        ;  call modifiers: sync/async, deferred, immed, etc 
  140. paramSize                 ds.b    1                ; offset: $1 (1)        ;  size in bytes of actual parameters passed to this call 
  141. what                     ds.w    1                ; offset: $2 (2)        ;  routine selector, negative for Component management calls 
  142. params                     ds.l    1                ; offset: $4 (4) <-- really an array of length one ;  actual parameters for the indicated routine 
  143. sizeof                     EQU *                    ; size:   $8 (8)
  144.                         ENDR
  145. ComponentRecord            RECORD 0
  146. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  147. sizeof                     EQU *                    ; size:   $4 (4)
  148.                         ENDR
  149. ; typedef struct ComponentRecord *        Component
  150.  
  151. ComponentInstanceRecord    RECORD 0
  152. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  153. sizeof                     EQU *                    ; size:   $4 (4)
  154.                         ENDR
  155. ; typedef struct ComponentInstanceRecord * ComponentInstance
  156.  
  157. RegisteredComponentRecord RECORD 0
  158. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  159. sizeof                     EQU *                    ; size:   $4 (4)
  160.                         ENDR
  161. RegisteredComponentInstanceRecord RECORD 0
  162. data                     ds.l    1                ; offset: $0 (0) <-- really an array of length one
  163. sizeof                     EQU *                    ; size:   $4 (4)
  164.                         ENDR
  165. ; typedef struct RegisteredComponentInstanceRecord * RegisteredComponentInstanceRecordPtr
  166.  
  167. ; typedef long                             ComponentResult
  168.  
  169.  
  170. platform68k                        EQU        1                    ; platform type (response from gestaltSysArchitecture) 
  171. platformPowerPC                    EQU        2
  172. platformInterpreted                EQU        3
  173. platformWin32                    EQU        4
  174.  
  175. mpWorkFlagDoWork                EQU        $01
  176. mpWorkFlagDoCompletion            EQU        $02
  177. mpWorkFlagCopyWorkBlock            EQU        $04
  178. mpWorkFlagDontBlock                EQU        $08
  179. mpWorkFlagGetProcessorCount        EQU        $10
  180. mpWorkFlagGetIsRunning            EQU        $40
  181. ComponentMPWorkFunctionHeaderRecord RECORD 0
  182. headerSize                 ds.l    1                ; offset: $0 (0)
  183. recordSize                 ds.l    1                ; offset: $4 (4)
  184. workFlags                 ds.l    1                ; offset: $8 (8)
  185. processorCount             ds.w    1                ; offset: $C (12)
  186. unused                     ds.b    1                ; offset: $E (14)
  187. isRunning                 ds.b    1                ; offset: $F (15)
  188. sizeof                     EQU *                    ; size:   $10 (16)
  189.                         ENDR
  190. ; typedef struct ComponentMPWorkFunctionHeaderRecord * ComponentMPWorkFunctionHeaderRecordPtr
  191.  
  192. ;    The parameter list for each ComponentFunction is unique. It is
  193. ;    therefore up to users to create the appropriate procInfo for their
  194. ;    own ComponentFunctions where necessary.
  195. ;
  196.  
  197. ; typedef UniversalProcPtr                 ComponentFunctionUPP
  198.  
  199.  
  200. ; ********************************************************
  201. ;*                                                        *
  202. ;*                  APPLICATION LEVEL CALLS                    *
  203. ;*                                                        *
  204. ;*******************************************************
  205.  
  206. ; ********************************************************
  207. ;* Component Database Add, Delete, and Query Routines
  208. ;*******************************************************
  209.  
  210. ;
  211. ; pascal Component RegisterComponent(ComponentDescription *cd, ComponentRoutineUPP componentEntryPoint, short global, Handle componentName, Handle componentInfo, Handle componentIcon)
  212. ;
  213.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  214.         Macro
  215.         _RegisterComponent
  216.             moveq               #1,D0
  217.             dc.w                $A82A
  218.         EndM
  219.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  220.         IMPORT_CFM_FUNCTION RegisterComponent
  221.     ENDIF
  222.  
  223. ;
  224. ; pascal Component RegisterComponentResource(ComponentResourceHandle cr, short global)
  225. ;
  226.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  227.         Macro
  228.         _RegisterComponentResource
  229.             moveq               #18,D0
  230.             dc.w                $A82A
  231.         EndM
  232.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  233.         IMPORT_CFM_FUNCTION RegisterComponentResource
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal OSErr UnregisterComponent(Component aComponent)
  238. ;
  239.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  240.         Macro
  241.         _UnregisterComponent
  242.             moveq               #2,D0
  243.             dc.w                $A82A
  244.         EndM
  245.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  246.         IMPORT_CFM_FUNCTION UnregisterComponent
  247.     ENDIF
  248.  
  249. ;
  250. ; pascal Component FindNextComponent(Component aComponent, ComponentDescription *looking)
  251. ;
  252.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  253.         Macro
  254.         _FindNextComponent
  255.             moveq               #4,D0
  256.             dc.w                $A82A
  257.         EndM
  258.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  259.         IMPORT_CFM_FUNCTION FindNextComponent
  260.     ENDIF
  261.  
  262. ;
  263. ; pascal long CountComponents(ComponentDescription *looking)
  264. ;
  265.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  266.         Macro
  267.         _CountComponents
  268.             moveq               #3,D0
  269.             dc.w                $A82A
  270.         EndM
  271.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  272.         IMPORT_CFM_FUNCTION CountComponents
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal OSErr GetComponentInfo(Component aComponent, ComponentDescription *cd, Handle componentName, Handle componentInfo, Handle componentIcon)
  277. ;
  278.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  279.         Macro
  280.         _GetComponentInfo
  281.             moveq               #5,D0
  282.             dc.w                $A82A
  283.         EndM
  284.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  285.         IMPORT_CFM_FUNCTION GetComponentInfo
  286.     ENDIF
  287.  
  288. ;
  289. ; pascal long GetComponentListModSeed(void )
  290. ;
  291.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  292.         Macro
  293.         _GetComponentListModSeed
  294.             moveq               #6,D0
  295.             dc.w                $A82A
  296.         EndM
  297.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  298.         IMPORT_CFM_FUNCTION GetComponentListModSeed
  299.     ENDIF
  300.  
  301. ;
  302. ; pascal long GetComponentTypeModSeed(OSType componentType)
  303. ;
  304.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  305.         Macro
  306.         _GetComponentTypeModSeed
  307.             moveq               #44,D0
  308.             dc.w                $A82A
  309.         EndM
  310.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  311.         IMPORT_CFM_FUNCTION GetComponentTypeModSeed
  312.     ENDIF
  313.  
  314. ; ********************************************************
  315. ;* Component Instance Allocation and dispatch routines
  316. ;*******************************************************
  317.  
  318. ;
  319. ; pascal OSErr OpenAComponent(Component aComponent, ComponentInstance *ci)
  320. ;
  321.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  322.         Macro
  323.         _OpenAComponent
  324.             moveq               #45,D0
  325.             dc.w                $A82A
  326.         EndM
  327.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  328.         IMPORT_CFM_FUNCTION OpenAComponent
  329.     ENDIF
  330.  
  331. ;
  332. ; pascal ComponentInstance OpenComponent(Component aComponent)
  333. ;
  334.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  335.         Macro
  336.         _OpenComponent
  337.             moveq               #7,D0
  338.             dc.w                $A82A
  339.         EndM
  340.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  341.         IMPORT_CFM_FUNCTION OpenComponent
  342.     ENDIF
  343.  
  344. ;
  345. ; pascal OSErr CloseComponent(ComponentInstance aComponentInstance)
  346. ;
  347.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  348.         Macro
  349.         _CloseComponent
  350.             moveq               #8,D0
  351.             dc.w                $A82A
  352.         EndM
  353.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  354.         IMPORT_CFM_FUNCTION CloseComponent
  355.     ENDIF
  356.  
  357. ;
  358. ; pascal OSErr GetComponentInstanceError(ComponentInstance aComponentInstance)
  359. ;
  360.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  361.         Macro
  362.         _GetComponentInstanceError
  363.             moveq               #10,D0
  364.             dc.w                $A82A
  365.         EndM
  366.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  367.         IMPORT_CFM_FUNCTION GetComponentInstanceError
  368.     ENDIF
  369.  
  370. ; ********************************************************
  371. ;*                                                        *
  372. ;*                      CALLS MADE BY COMPONENTS              *
  373. ;*                                                        *
  374. ;*******************************************************
  375.  
  376. ; ********************************************************
  377. ;* Component Management routines
  378. ;*******************************************************
  379.  
  380. ;
  381. ; pascal void SetComponentInstanceError(ComponentInstance aComponentInstance, OSErr theError)
  382. ;
  383.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  384.         Macro
  385.         _SetComponentInstanceError
  386.             moveq               #11,D0
  387.             dc.w                $A82A
  388.         EndM
  389.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  390.         IMPORT_CFM_FUNCTION SetComponentInstanceError
  391.     ENDIF
  392.  
  393. ;
  394. ; pascal long GetComponentRefcon(Component aComponent)
  395. ;
  396.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  397.         Macro
  398.         _GetComponentRefcon
  399.             moveq               #16,D0
  400.             dc.w                $A82A
  401.         EndM
  402.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  403.         IMPORT_CFM_FUNCTION GetComponentRefcon
  404.     ENDIF
  405.  
  406. ;
  407. ; pascal void SetComponentRefcon(Component aComponent, long theRefcon)
  408. ;
  409.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  410.         Macro
  411.         _SetComponentRefcon
  412.             moveq               #17,D0
  413.             dc.w                $A82A
  414.         EndM
  415.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  416.         IMPORT_CFM_FUNCTION SetComponentRefcon
  417.     ENDIF
  418.  
  419. ;
  420. ; pascal short OpenComponentResFile(Component aComponent)
  421. ;
  422.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  423.         Macro
  424.         _OpenComponentResFile
  425.             moveq               #21,D0
  426.             dc.w                $A82A
  427.         EndM
  428.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION OpenComponentResFile
  430.     ENDIF
  431.  
  432. ;
  433. ; pascal OSErr OpenAComponentResFile(Component aComponent, short *resRef)
  434. ;
  435.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  436.         Macro
  437.         _OpenAComponentResFile
  438.             moveq               #47,D0
  439.             dc.w                $A82A
  440.         EndM
  441.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  442.         IMPORT_CFM_FUNCTION OpenAComponentResFile
  443.     ENDIF
  444.  
  445. ;
  446. ; pascal OSErr CloseComponentResFile(short refnum)
  447. ;
  448.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  449.         Macro
  450.         _CloseComponentResFile
  451.             moveq               #24,D0
  452.             dc.w                $A82A
  453.         EndM
  454.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  455.         IMPORT_CFM_FUNCTION CloseComponentResFile
  456.     ENDIF
  457.  
  458. ;
  459. ; pascal OSErr GetComponentResource(Component aComponent, OSType resType, short resID, Handle *theResource)
  460. ;
  461.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  462.         Macro
  463.         _GetComponentResource
  464.             moveq               #53,D0
  465.             dc.w                $A82A
  466.         EndM
  467.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  468.         IMPORT_CFM_FUNCTION GetComponentResource
  469.     ENDIF
  470.  
  471. ;
  472. ; pascal OSErr GetComponentIndString(Component aComponent, Str255 theString, short strListID, short index)
  473. ;
  474.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  475.         Macro
  476.         _GetComponentIndString
  477.             moveq               #54,D0
  478.             dc.w                $A82A
  479.         EndM
  480.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  481.         IMPORT_CFM_FUNCTION GetComponentIndString
  482.     ENDIF
  483.  
  484. ;
  485. ; pascal Component ResolveComponentAlias(Component aComponent)
  486. ;
  487.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  488.         Macro
  489.         _ResolveComponentAlias
  490.             moveq               #32,D0
  491.             dc.w                $A82A
  492.         EndM
  493.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  494.         IMPORT_CFM_FUNCTION ResolveComponentAlias
  495.     ENDIF
  496.  
  497. ; ********************************************************
  498. ;* Component Instance Management routines
  499. ;*******************************************************
  500.  
  501. ;
  502. ; pascal Handle GetComponentInstanceStorage(ComponentInstance aComponentInstance)
  503. ;
  504.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  505.         Macro
  506.         _GetComponentInstanceStorage
  507.             moveq               #12,D0
  508.             dc.w                $A82A
  509.         EndM
  510.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  511.         IMPORT_CFM_FUNCTION GetComponentInstanceStorage
  512.     ENDIF
  513.  
  514. ;
  515. ; pascal void SetComponentInstanceStorage(ComponentInstance aComponentInstance, Handle theStorage)
  516. ;
  517.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  518.         Macro
  519.         _SetComponentInstanceStorage
  520.             moveq               #13,D0
  521.             dc.w                $A82A
  522.         EndM
  523.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  524.         IMPORT_CFM_FUNCTION SetComponentInstanceStorage
  525.     ENDIF
  526.  
  527. ;
  528. ; pascal long GetComponentInstanceA5(ComponentInstance aComponentInstance)
  529. ;
  530.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  531.         Macro
  532.         _GetComponentInstanceA5
  533.             moveq               #14,D0
  534.             dc.w                $A82A
  535.         EndM
  536.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION GetComponentInstanceA5
  538.     ENDIF
  539.  
  540. ;
  541. ; pascal void SetComponentInstanceA5(ComponentInstance aComponentInstance, long theA5)
  542. ;
  543.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  544.         Macro
  545.         _SetComponentInstanceA5
  546.             moveq               #15,D0
  547.             dc.w                $A82A
  548.         EndM
  549.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  550.         IMPORT_CFM_FUNCTION SetComponentInstanceA5
  551.     ENDIF
  552.  
  553. ;
  554. ; pascal long CountComponentInstances(Component aComponent)
  555. ;
  556.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  557.         Macro
  558.         _CountComponentInstances
  559.             moveq               #19,D0
  560.             dc.w                $A82A
  561.         EndM
  562.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  563.         IMPORT_CFM_FUNCTION CountComponentInstances
  564.     ENDIF
  565.  
  566. ;  useful helper routines for convenient method dispatching 
  567. ;
  568. ; pascal long CallComponentFunction(ComponentParameters *params, ComponentFunctionUPP func)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  571.         Macro
  572.         _CallComponentFunction
  573.             moveq               #-1,D0
  574.             dc.w                $A82A
  575.         EndM
  576.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  577.         IMPORT_CFM_FUNCTION CallComponentFunction
  578.     ENDIF
  579.  
  580. ;
  581. ; pascal long CallComponentFunctionWithStorage(Handle storage, ComponentParameters *params, ComponentFunctionUPP func)
  582. ;
  583.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  584.         Macro
  585.         _CallComponentFunctionWithStorage
  586.             moveq               #-1,D0
  587.             dc.w                $A82A
  588.         EndM
  589.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  590.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorage
  591.     ENDIF
  592.  
  593.     IF TARGET_CPU_PPC ** TARGET_OS_MAC THEN
  594. ;
  595. ; pascal long CallComponentFunctionWithStorageProcInfo(Handle storage, ComponentParameters *params, ProcPtr func, long funcProcInfo)
  596. ;
  597.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  598.         IMPORT_CFM_FUNCTION CallComponentFunctionWithStorageProcInfo
  599.     ENDIF
  600.  
  601.     ELSE
  602.     ENDIF
  603. ;
  604. ; pascal long DelegateComponentCall(ComponentParameters *originalParams, ComponentInstance ci)
  605. ;
  606.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  607.         Macro
  608.         _DelegateComponentCall
  609.             moveq               #36,D0
  610.             dc.w                $A82A
  611.         EndM
  612.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  613.         IMPORT_CFM_FUNCTION DelegateComponentCall
  614.     ENDIF
  615.  
  616. ;
  617. ; pascal OSErr SetDefaultComponent(Component aComponent, short flags)
  618. ;
  619.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  620.         Macro
  621.         _SetDefaultComponent
  622.             moveq               #30,D0
  623.             dc.w                $A82A
  624.         EndM
  625.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  626.         IMPORT_CFM_FUNCTION SetDefaultComponent
  627.     ENDIF
  628.  
  629. ;
  630. ; pascal ComponentInstance OpenDefaultComponent(OSType componentType, OSType componentSubType)
  631. ;
  632.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  633.         Macro
  634.         _OpenDefaultComponent
  635.             moveq               #33,D0
  636.             dc.w                $A82A
  637.         EndM
  638.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  639.         IMPORT_CFM_FUNCTION OpenDefaultComponent
  640.     ENDIF
  641.  
  642. ;
  643. ; pascal OSErr OpenADefaultComponent(OSType componentType, OSType componentSubType, ComponentInstance *ci)
  644. ;
  645.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  646.         Macro
  647.         _OpenADefaultComponent
  648.             moveq               #46,D0
  649.             dc.w                $A82A
  650.         EndM
  651.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  652.         IMPORT_CFM_FUNCTION OpenADefaultComponent
  653.     ENDIF
  654.  
  655. ;
  656. ; pascal Component CaptureComponent(Component capturedComponent, Component capturingComponent)
  657. ;
  658.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  659.         Macro
  660.         _CaptureComponent
  661.             moveq               #28,D0
  662.             dc.w                $A82A
  663.         EndM
  664.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  665.         IMPORT_CFM_FUNCTION CaptureComponent
  666.     ENDIF
  667.  
  668. ;
  669. ; pascal OSErr UncaptureComponent(Component aComponent)
  670. ;
  671.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  672.         Macro
  673.         _UncaptureComponent
  674.             moveq               #29,D0
  675.             dc.w                $A82A
  676.         EndM
  677.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  678.         IMPORT_CFM_FUNCTION UncaptureComponent
  679.     ENDIF
  680.  
  681. ;
  682. ; pascal long RegisterComponentResourceFile(short resRefNum, short global)
  683. ;
  684.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  685.         Macro
  686.         _RegisterComponentResourceFile
  687.             moveq               #20,D0
  688.             dc.w                $A82A
  689.         EndM
  690.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  691.         IMPORT_CFM_FUNCTION RegisterComponentResourceFile
  692.     ENDIF
  693.  
  694. ;
  695. ; pascal OSErr GetComponentIconSuite(Component aComponent, Handle *iconSuite)
  696. ;
  697.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  698.         Macro
  699.         _GetComponentIconSuite
  700.             moveq               #41,D0
  701.             dc.w                $A82A
  702.         EndM
  703.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  704.         IMPORT_CFM_FUNCTION GetComponentIconSuite
  705.     ENDIF
  706.  
  707.  
  708. ; ********************************************************
  709. ;*                                                        *
  710. ;*              Direct calls to the Components                *
  711. ;*                                                        *
  712. ;*******************************************************
  713.  
  714. ;  Old style names
  715.  
  716. ;
  717. ; pascal long ComponentFunctionImplemented(ComponentInstance ci, short ftnNumber)
  718. ;
  719.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  720.         Macro
  721.         _ComponentFunctionImplemented
  722.             move.l              #$0002FFFD,-(sp)
  723.             moveq               #0,D0
  724.             dc.w                $A82A
  725.         EndM
  726.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  727.         IMPORT_CFM_FUNCTION ComponentFunctionImplemented
  728.     ENDIF
  729.  
  730. ;
  731. ; pascal long GetComponentVersion(ComponentInstance ci)
  732. ;
  733.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  734.         Macro
  735.         _GetComponentVersion
  736.             move.l              #$0000FFFC,-(sp)
  737.             moveq               #0,D0
  738.             dc.w                $A82A
  739.         EndM
  740.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  741.         IMPORT_CFM_FUNCTION GetComponentVersion
  742.     ENDIF
  743.  
  744. ;
  745. ; pascal long ComponentSetTarget(ComponentInstance ci, ComponentInstance target)
  746. ;
  747.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  748.         Macro
  749.         _ComponentSetTarget
  750.             move.l              #$0004FFFA,-(sp)
  751.             moveq               #0,D0
  752.             dc.w                $A82A
  753.         EndM
  754.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  755.         IMPORT_CFM_FUNCTION ComponentSetTarget
  756.     ENDIF
  757.  
  758. ;  New style names
  759.  
  760. ;
  761. ; pascal ComponentResult CallComponentOpen(ComponentInstance ci, ComponentInstance self)
  762. ;
  763.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  764.         Macro
  765.         _CallComponentOpen
  766.             move.l              #$0004FFFF,-(sp)
  767.             moveq               #0,D0
  768.             dc.w                $A82A
  769.         EndM
  770.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  771.         IMPORT_CFM_FUNCTION CallComponentOpen
  772.     ENDIF
  773.  
  774. ;
  775. ; pascal ComponentResult CallComponentClose(ComponentInstance ci, ComponentInstance self)
  776. ;
  777.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  778.         Macro
  779.         _CallComponentClose
  780.             move.l              #$0004FFFE,-(sp)
  781.             moveq               #0,D0
  782.             dc.w                $A82A
  783.         EndM
  784.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  785.         IMPORT_CFM_FUNCTION CallComponentClose
  786.     ENDIF
  787.  
  788. ;
  789. ; pascal ComponentResult CallComponentCanDo(ComponentInstance ci, short ftnNumber)
  790. ;
  791.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  792.         Macro
  793.         _CallComponentCanDo
  794.             move.l              #$0002FFFD,-(sp)
  795.             moveq               #0,D0
  796.             dc.w                $A82A
  797.         EndM
  798.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  799.         IMPORT_CFM_FUNCTION CallComponentCanDo
  800.     ENDIF
  801.  
  802. ;
  803. ; pascal ComponentResult CallComponentVersion(ComponentInstance ci)
  804. ;
  805.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  806.         Macro
  807.         _CallComponentVersion
  808.             move.l              #$0000FFFC,-(sp)
  809.             moveq               #0,D0
  810.             dc.w                $A82A
  811.         EndM
  812.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  813.         IMPORT_CFM_FUNCTION CallComponentVersion
  814.     ENDIF
  815.  
  816. ;
  817. ; pascal ComponentResult CallComponentRegister(ComponentInstance ci)
  818. ;
  819.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  820.         Macro
  821.         _CallComponentRegister
  822.             move.l              #$0000FFFB,-(sp)
  823.             moveq               #0,D0
  824.             dc.w                $A82A
  825.         EndM
  826.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  827.         IMPORT_CFM_FUNCTION CallComponentRegister
  828.     ENDIF
  829.  
  830. ;
  831. ; pascal ComponentResult CallComponentTarget(ComponentInstance ci, ComponentInstance target)
  832. ;
  833.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  834.         Macro
  835.         _CallComponentTarget
  836.             move.l              #$0004FFFA,-(sp)
  837.             moveq               #0,D0
  838.             dc.w                $A82A
  839.         EndM
  840.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  841.         IMPORT_CFM_FUNCTION CallComponentTarget
  842.     ENDIF
  843.  
  844. ;
  845. ; pascal ComponentResult CallComponentUnregister(ComponentInstance ci)
  846. ;
  847.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  848.         Macro
  849.         _CallComponentUnregister
  850.             move.l              #$0000FFF9,-(sp)
  851.             moveq               #0,D0
  852.             dc.w                $A82A
  853.         EndM
  854.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  855.         IMPORT_CFM_FUNCTION CallComponentUnregister
  856.     ENDIF
  857.  
  858. ;
  859. ; pascal ComponentResult CallComponentGetMPWorkFunction(ComponentInstance ci, ComponentMPWorkFunctionUPP *workFunction, void **refCon)
  860. ;
  861.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  862.         Macro
  863.         _CallComponentGetMPWorkFunction
  864.             move.l              #$0008FFF8,-(sp)
  865.             moveq               #0,D0
  866.             dc.w                $A82A
  867.         EndM
  868.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  869.         IMPORT_CFM_FUNCTION CallComponentGetMPWorkFunction
  870.     ENDIF
  871.  
  872.  
  873.     IF ¬ TARGET_OS_MAC THEN
  874. ;  
  875. ;        CallComponent is used by ComponentGlue routines to manually call a component function.
  876. ;     
  877.  
  878. ;
  879. ; pascal ComponentResult CallComponent(ComponentInstance ci, ComponentParameters *cp)
  880. ;
  881.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  882.         IMPORT_CFM_FUNCTION CallComponent
  883.     ENDIF
  884.  
  885.     ENDIF
  886. ;  UPP call backs 
  887. ;  ProcInfos 
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.     ENDIF ; __COMPONENTS__ 
  895.  
  896.